//
//  LuaCATransform3D.h
//  MapKitExample
//
//  Created by liwei on 13-11-3.
//
//

#import <Foundation/Foundation.h>

@interface LuaCATransform3D : NSObject

/* The identity transform: [1 0 0 0; 0 1 0 0; 0 0 1 0; 0 0 0 1]. */

+ (CATransform3D)CATransform3DIdentityV;

/* Returns true if 't' is the identity transform. */

+ (BOOL)CATransform3DIsIdentityT:(CATransform3D) t;

/* Returns true if 'a' is exactly equal to 'b'. */

+ (BOOL)CATransform3DEqualToTransformA:(CATransform3D)a b:(CATransform3D)b;

/* Returns a transform that translates by '(tx, ty, tz)':
 * t' =  [1 0 0 0; 0 1 0 0; 0 0 1 0; tx ty tz 1]. */

+ (CATransform3D)CATransform3DMakeTranslationTx:(CGFloat)tx ty:(CGFloat)ty tz:(CGFloat)tz;

/* Returns a transform that scales by `(sx, sy, sz)':
 * t' = [sx 0 0 0; 0 sy 0 0; 0 0 sz 0; 0 0 0 1]. */

+ (CATransform3D)CATransform3DMakeScaleSx:(CGFloat)sx sy:(CGFloat)sy sz:(CGFloat)sz;

/* Returns a transform that rotates by 'angle' radians about the vector
 * '(x, y, z)'. If the vector has length zero the identity transform is
 * returned. */

+ (CATransform3D)CATransform3DMakeRotationAngle:(CGFloat)angle x:(CGFloat)x y:(CGFloat)y z:(CGFloat)z;

/* Translate 't' by '(tx, ty, tz)' and return the result:
 * t' = translate(tx, ty, tz) * t. */

+ (CATransform3D)CATransform3DTranslateT:(CATransform3D)t tx:(CGFloat)tx ty:(CGFloat)ty tz:(CGFloat)tz;

/* Scale 't' by '(sx, sy, sz)' and return the result:
 * t' = scale(sx, sy, sz) * t. */

+ (CATransform3D)CATransform3DScaleT:(CATransform3D)t sx:(CGFloat)sx sy:(CGFloat)sy sz:(CGFloat)sz;

/* Rotate 't' by 'angle' radians about the vector '(x, y, z)' and return
 * the result. If the vector has zero length the behavior is undefined:
 * t' = rotation(angle, x, y, z) * t. */

+ (CATransform3D)CATransform3DRotateT:(CATransform3D)t angle:(CGFloat)angle x:(CGFloat)x y:(CGFloat)y z:(CGFloat) z;

/* Concatenate 'b' to 'a' and return the result: t' = a * b. */

+ (CATransform3D)CATransform3DConcatA:(CATransform3D)a b:(CATransform3D)b;

/* Invert 't' and return the result. Returns the original matrix if 't'
 * has no inverse. */

+ (CATransform3D)CATransform3DInvertT:(CATransform3D)t;

/* Return a transform with the same effect as affine transform 'm'. */

+ (CATransform3D)CATransform3DMakeAffineTransformM:(CGAffineTransform)m;

/* Returns true if 't' can be represented exactly by an affine transform. */

+ (BOOL)CATransform3DIsAffineT:(CATransform3D)t;

/* Returns the affine transform represented by 't'. If 't' can not be
 * represented exactly by an affine transform the returned value is
 * undefined. */

+ (CGAffineTransform)CATransform3DGetAffineTransformT:(CATransform3D)t;

@end
